import type { RouterConfig } from '@nuxt/schema'
import { createMemoryHistory } from 'vue-router'

// 自定义路由直接在这里写就行，不需要在 nuxt.config 再配置
export default <RouterConfig> {
  routes: (_routes) => [
    {
      name: 'index',
      path: '/',
      component: () => import('~/pages/index.vue').then(r => r.default || r)
    },
    {
      name: 'user',
      path: '/user',
      component: () => import('~/pages/parent/index.vue').then(r => r.default || r)
    },
    {
      name: 'name',
      path: '/name',
      component: () => import('~/pages/name/index.vue').then(r => r.default || r)
    }
  ],
  // 设置了这句 path 不会在 url 上面显示
  // history: base => process.client ? createMemoryHistory(base) : null /* default */ 
}
